//
//  SIXMainNavController.m
//  FastDoctor_6
//
//  Created by cool on 16/3/1.
//  Copyright © 2016年 cool. All rights reserved.
//

#import "SIXMainNavController.h"

@interface SIXMainNavController ()

@end

@implementation SIXMainNavController

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    [super pushViewController:viewController animated:YES];
    
    UIButton *btn = [[UIButton alloc] init];
    [btn setImage:[UIImage imageNamed:@"navback-2"] forState:UIControlStateNormal];
    [btn sizeToFit];
    [btn addTarget:self  action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:btn ];
    viewController.navigationItem.leftBarButtonItem = backItem;
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav"] forBarMetrics:UIBarMetricsDefault];
    self.navigationBar.tintColor = [UIColor whiteColor];
    self.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
    
}

- (void)back{
    
    
    [self popViewControllerAnimated:YES];
    
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
